#include <stdio.h>

struct student
{
	char sno[8];
	char name[20];
	char sex;
	int age;
	double score;
};

int main(void)
{	
	struct student s[3];
	int i;
	double sum = 0, avg;

	puts("Input three students' information(sex, sno, name, age, score):");
	for (i = 0; i < 3; i++)
	{
		scanf("%c%s%s%d%lf", &s[i].sex, s[i].sno, s[i].name, &s[i].age, &s[i].score);
		getchar();
		sum += s[i].score;
	}
	avg = sum / 3;
	printf("avg = %4.1f\n", avg);
	puts("  sno              name       sex   age   score");
	for (i = 0; i < 3; i++)
		if (s[i].score > avg)
			printf("%s%20s%5c%5d%8.1f\n", s[i].sno, s[i].name, s[i].sex, s[i].age, s[i].score);

	return 0;
}